I lost my admin user (Mac OS X 10.5)
Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software products that may be mentioned in the topic below. Apple encourages you to first seek a solution at
Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information below at your own discretion.
I lost my admin user (Mac OS X 10.5)
If you are unfortunate enough to delete your only admin user, or remove his admin capability, then as long as you have another user with login capability, you can give that user admin rights as shown below. You can then re-create the original user or reinstate the admin capability using the Accounts Pane in System Preferences.
Print this post out in a mono-spaced font, and type carefully, paying attention to spaces and punctuation, since you cannot copy/paste in Single User mode. Note that everything is case-sensitive.
Caution: in single user mode you have root privileges. Be careful! Substitute the short name of "youruser" below.
Boot into single user mode (Command-S) at startup which will eventually get you a shell prompt (ending in #). Then type the following:
fsck -fyRepeat the above until it says your disk is OK. Then continue with
mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist
launchctl listVerify that the first command worked: you should see "com.apple.DirectoryServicesLocal.plist" listed in the "label" column. It will probably have a "status" of zero. The next command isn't strictly necessary, it just makes the dscl command quite a bit faster:
launchctl start com.apple.DirectoryServicesLocal
dscl localonly -merge /Local/Target/Groups/admin users youruserIf you want to check that "youruser" is now in the admin group, then
dscl localonly -read /Local/Target/Groups/admin usersshould tell you. Then
rebootYou will now be able to login as "youruser" and have administrative privileges.
Membership of the admin group is the only thing that distinguishes administrative users from ordinary users.
--------------
Do you want to provide feedback on this User Contributed Tip or contribute your own? If you have achieved Level 2 status, visit the
User Tips Library Contributions forum for more information.